package com.sshtools.start;

import java.util.Map;

import tsif.component.resource.Config;
import tsif.component.resource.ParamConfig;
import tsif.utils.SystemUtils.ArgUtils.SystemArg;

/**
 * 配置管理器
 *
 */
public class ConfigMgr {
	public static final SystemArg SYSARG_COMMON = new SystemArg("--commond", "", "是否启用命令行模式");
	public static final SystemArg SYSARG_HELP = new SystemArg("--help", "", "帮助模式");

	// 指令模式参数
	public static final SystemArg SYSARG_C_HOST = new SystemArg("--host", null, "服务器host");
	public static final SystemArg SYSARG_C_PORT = new SystemArg("--port", null, "服务器port");
	public static final SystemArg SYSARG_C_USENAME = new SystemArg("--username", null, "username");
	public static final SystemArg SYSARG_C_PASSWORD = new SystemArg("--password", null, "password");
	public static final SystemArg SYSARG_C_TIMEOUT = new SystemArg("--timeout", "10000", "连接超时");
	public static final SystemArg SYSARG_C_REMOTEPATH = new SystemArg("--remotepath", null, "远程目录");
	public static final SystemArg SYSARG_C_EXECCMD = new SystemArg("--execcmd", null, "执行指令");
	public static final SystemArg SYSARG_C_SHFILE = new SystemArg("--shfile", null, "执行的脚本文件");
	public static final SystemArg SYSARG_C_UPLOADFILE = new SystemArg("--uploadfile", null, "上传文件(支持目录)");
	public static final SystemArg SYSARG_C_FINSIHCLEAN = new SystemArg("--finishclean", null, "运行结束清除痕迹");

	// 视图模式参数
	public static final SystemArg SYSARG_SERVERXMLPATH = new SystemArg("--serverXmlPath", "conf/servers.xml", "serverxml所在路径");

	public static final Config config = new ParamConfig();

	protected static boolean init(Map<String, String> params) {
		((ParamConfig) config).reload(params.entrySet());
		return true;
	}

}
